package top.easycode.app.util;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;

/**
 * Bean处理的工具类
 * @author AlexZhu
 * @version 1.0.1
 */
public class BeanUtil {
	
	 public static final Logger log = LoggerFactory.getLogger(BeanUtil.class);
	 
	/**
	 * 利用Apache的Bean copy工具
	 * @param source
	 * @param goal
	 * @author guoyanjiang
	 * @creation 20152015-5-5上午11:54:24
	 */
	public static void beanCopyByEqualName(Object source, Object goal){
		if(source == null || goal == null){return;}
		
		try {
			BeanUtils.copyProperties(goal, source);
		} catch (Exception e) {
			log.error(e.getMessage(), e);
		}
	}
	
}
